package
{
	import com.junkbyte.console.Cc;
	import com.junkbyte.console.KeyBind;

	import flash.display.Sprite;
	import flash.utils.getTimer;

	public class module2 extends Sprite
	{
		public function module2()
		{
			Cc.debug("module2 init!");
			Cc.bindKey(new KeyBind("a"), a);
			Cc.bindKey(new KeyBind("b"), b);

			Cc.bindKey(new KeyBind("t"), t);
		}

		public function a():void
		{
			GameDispatcher.instance.dispatchEvent(new GameEvent("show_module1"));
		}

		public function b():void
		{
			GameDispatcher.instance.dispatchEvent(new GameEvent("close_module1"));
		}

		public function t():void
		{
			var startTime:int = getTimer();
			for (var i:int = 0; i < 100; i++)
			{
				a();
				b();
			}
			Cc.debug("module2花费：" + (getTimer() - startTime));
		}

	}
}
